package com.macrosolution.exdebito

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * Perito
 * A domain class describes the data object and it's mapping to the database
 */
class Perito implements Serializable{

	/* Default (injected) attributes of GORM */
//	Long	id
//	Long	version
	
	/* Automatic timestamping of GORM */
//	Date	dateCreated
//	Date	lastUpdated
	
//	static	belongsTo	= []	// tells GORM to cascade commands: e.g., delete this object if the "parent" is deleted.
//	static	hasOne		= []	// tells GORM to associate another domain object as an owner in a 1-1 mapping
//	static	hasMany		= []	// tells GORM to associate other domain objects for a 1-n or n-m mapping
//	static	mappedBy	= []	// specifies which property should be used in a mapping 
	
	String username
	String password
	String originalPassword
	String name
	String surname
	String cf
	String piva
	String phone
	String mobile
	String personal_email
	String company_email
	Date born
	Provincia bornProvince
	Address fiscalAddress
	Integer age
	Date	dateCreated
	Date	lastUpdated
	User owner
	boolean enabled = true
	boolean accountExpired
	boolean accountLocked
	boolean passwordExpired
	
    static	mapping = {
    }
    
	static	constraints = {
		username nullable:true
		password nullable:true
		originalPassword nullable:true
		name nullable:true
		surname nullable:true
		cf nullable:true
		piva nullable:true
		phone nullable:true
		mobile nullable:true
		personal_email nullable:true
		company_email nullable:true
		born nullable:true
		bornProvince nullable:true
		fiscalAddress nullable:true
		age nullable:true
		owner nullable:true
		enabled nullable:true
		accountExpired nullable:true
		accountLocked nullable:true
		passwordExpired nullable:true
    }
	
	/*
	 * Methods of the Domain Class
	 */
//	@Override	// Override toString for a nicer / more descriptive UI 
//	public String toString() {
//		return "${name}";
//	}
}
